<template>
	<scroll-view class="container" scroll-y @scrolltolower="reachBottom">
		<view class="status_bar">
			<!-- 这里是状态栏 -->
		</view>
		<!-- 返回按钮 -->
		<view class="goback">
			<u-icon @click="goback" name="arrow-left" color="#ffffff" size="40rpx"></u-icon>
		</view>
		<view class="title">VS拼团专区</view>
		<view class="title-2">开启拼团模式</view>
		<view class="img-box">
			<image style="width: 630rpx;" src="../../static/pintuan.png" mode="widthFix"></image>
		</view>

		<view class="contert" v-for="(item,index) in dataList">
			<view>
				<image style="width: 220rpx; height: 220rpx;" :src="item.imageUrl"></image>
			</view>
			<view class="product-del">
				<view class="name">{{item.goodsName}}</view>
				<view class="paystyle">
					<text>￥{{item.goodsPrice}}</text>
					<text style="margin-left: 30rpx;">单独买</text>
				</view>
				<view class="paygroup">
					<text>￥{{item.sharingPrice}}</text>
					<text style="margin-left: 30rpx;font-size: 26rpx;">{{item.people}}人团</text>
				</view>
				<view class="gopay" @click="gopintuan(item.goodsId)">去拼团</view>
			</view>
		</view>
	</scroll-view>
</template>

<script>
	import {
		GroupProductList
	} from '../../api/index.js'
	export default {
		data() {
			return {
				pagenum: 0,
				dataList: [],
				id:''
			}
		},
		onLoad() {
			this.getlist()
		},
		methods: {
			goback() {
				uni.switchTab({
					url: '../index/index'
				})
			},
			getlist() {
				this.pagenum++;
				this.get(GroupProductList, {
					pageNum: this.pagenum,
					pageSize: 10
				}).then(res => {
					console.log(res)
					this.dataList =[...this.dataList,...res.data.list]
				})
			},
			gopintuan(id){
				this.msg("暂无拼团资格...","none")
				// uni.navigateTo({
				// 	url:'../product/detail?type=5&id='+id
				// })
			},
			reachBottom() {
				this.getlist()
			},
		}
	}
</script>

<style>
	.status_bar {
		height: var(--status-bar-height);
		width: 100%;
	}

	.container {
		background-image: -webkit-linear-gradient(-90deg, #502DE3 0%, #FFD783 100%);
		height: 100vh;
	}

	.goback {
		margin: 30rpx 0 0 30rpx;
	}

	.title {
		width: 750rpx;
		height: 112rpx;
		font-size: 80rpx;
		font-weight: 600;
		line-height: 112px;
		color: #FFE24E;
		opacity: 1;
		text-align: center;
	}

	.title-2 {
		width: 750rpx;
		height: 75rpx;
		font-size: 54rpx;
		font-weight: 100;
		line-height: 75rpx;
		color: #FFE24E;
		opacity: 1;
		text-align: center;
		margin-top: 50rpx;
	}

	.img-box {
		width: 630rpx;
		margin: 20rpx auto;
	}

	.contert {
		width: 690rpx;
		height: 220rpx;
		border-radius: 10rpx;
		background: #FFFFFF;
		margin: 30rpx auto;
		display: flex;
		position: relative;

	}

	.product-del {
		padding: 20rpx;
	}

	.name {
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		font-size: 28rpx;
		color: #333333;
	}

	.paystyle {
		margin-top: 24rpx;
		font-size: 30rpx;
		color: #979797;
	}

	.paygroup {
		margin-top: 10rpx;
		color: #9f50ec;
		font-size: 32rpx;
	}

	.gopay {
		width: 120rpx;
		height: 60rpx;
		border-radius: 62rpx;
		color: #FFFFFF;
		text-align: center;
		line-height: 60rpx;
		background: linear-gradient(90deg, #F3C44E 0%, #F18D29 53%, #ED6138 100%);
		position: absolute;
		right: 30rpx;
		bottom: 20rpx;
	}
</style>
